$(function(){
	$(".del-new").click(function(){
		var new_id = $(this).attr('new_id');
		$.messager.confirm("删除提示","你真的要删除此新闻吗？删除后不可恢复",function(res){
			if(res){
				$.getJSON("index.php?file=catalog&action=deleteNew&id="+new_id+"&nocache="+Math.random(),function(json){
					if(json.status=="success"){
						window.location.reload();
					}else{
						$.messager.alert('提示信息', json.msg );
					}
				});
			}
		});
	});
	$("#add-new").click(function(){
		$("#window").window({
			href:"./index.php?file=catalog&action=addNew",
			title: "添加文章",
			width: 805,
			height: 400,
			cache:false,
			modal: true,
			shadow: false,
		    collapsible:false,
		    minimizable:false,
		    maximizable:false
		}).window("refresh");
	});
	$(".edit-new").click(function(){
		var new_id = $(this).attr('new_id');
		$("#window").window({
			href:"./index.php?file=catalog&action=editNew&id="+new_id,
			title: "编辑文章",
			width: 805,
			height: 400,
			cache:false,
			modal: true,
			shadow: false,
		    collapsible:false,
		    minimizable:false,
		    maximizable:false
		}).window("refresh");
	});
});